﻿using B.S.GridManage.Api.Read.Application.Command.GridTeam;
using B.S.GridManage.Api.Read.Dtos;
using B.S.GridManage.ErrorCode;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.S.GridManage.Api.Read.Controllers
{
    /// <summary>
    /// 网格队伍控制器
    /// </summary>

    [Route("api/[controller]/[action]")]
    [ApiController]
    public class TeamController : ControllerBase
    {
        private readonly IMediator mediator;
        /// <summary>
        /// 中介者组件注入
        /// </summary>
        /// <param name="mediator"></param>
        public TeamController(IMediator mediator)
        {
            this.mediator = mediator;
        }


        /// <summary>
        /// 根据网格名称和区域名称模糊查询网格队伍
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public   Task<ApiResult<List<GridTeamDto>>> GetGridTeamList([FromQuery]GetGridTeamCommand request) {
            return mediator.Send(request);
        }
    }
}
